﻿using SanZhan.Models.User;

namespace Model.ZhanFa
{
    public static class ZhanFaCPU
    {
        public static decimal BingrenBaseHarm(int bingli, decimal wuli, decimal tongshuai)
        {
            return 4.8M * Convert.ToDecimal(Math.Sqrt(bingli + 100)) * (200 + wuli) / (200 + tongshuai) * RandomPersent();
        }
        public static decimal CelueBaseHarm(int bingli, int zhili1, int zhili2)
        {
            return 4.8M * Convert.ToDecimal(Math.Sqrt(bingli + 100)) * (200 + zhili1) / (200 + zhili2) * RandomPersent();
        }

        public static decimal RandomPersent()
        {
            return (105 - new Random().Next(1, 9)) / 100M;
        }   
    }
}
